package com.ruoyi.project.meal.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.meal.domain.MealServiceObjects;
import com.ruoyi.project.meal.mapper.MealServiceObjectsMapper;
import com.ruoyi.project.meal.service.IMealServiceObjectsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 服务对象报餐记录Service业务层处理
 * 
 * @author ywy
 * @date 2024-03-05
 */
@Service
public class MealServiceObjectsServiceImpl implements IMealServiceObjectsService
{
    @Autowired
    private MealServiceObjectsMapper mealServiceObjectsMapper;

    /**
     * 查询服务对象报餐记录
     * 
     * @param id 服务对象报餐记录主键
     * @return 服务对象报餐记录
     */
    @Override
    public MealServiceObjects selectMealServiceObjectsById(Integer id)
    {
        return mealServiceObjectsMapper.selectMealServiceObjectsById(id);
    }

    /**
     * 查询服务对象报餐记录列表
     * 
     * @param mealServiceObjects 服务对象报餐记录
     * @return 服务对象报餐记录
     */
    @Override
    public List<MealServiceObjects> selectMealServiceObjectsList(MealServiceObjects mealServiceObjects)
    {
        return mealServiceObjectsMapper.selectMealServiceObjectsList(mealServiceObjects);
    }

    @Override
    public List<MealServiceObjects> selectCount(MealServiceObjects mealServiceObjects) {
        return mealServiceObjectsMapper.selectCount(mealServiceObjects);
    }

    /**
     *
     * @param mealServiceObjects 服务对象报餐记录
     * @return 服务对象报餐记录集合
     */
    public List<MealServiceObjects> selectReportList(MealServiceObjects mealServiceObjects){
        return mealServiceObjectsMapper.selectReportList(mealServiceObjects);
    }

    /**
     * 新增服务对象报餐记录
     * 
     * @param mealServiceObjects 服务对象报餐记录
     * @return 结果
     */
    @Override
    public int insertMealServiceObjects(MealServiceObjects mealServiceObjects)
    {
        mealServiceObjects.setCreateTime(DateUtils.getNowDate());
        return mealServiceObjectsMapper.insertMealServiceObjects(mealServiceObjects);
    }

    /**
     * 修改服务对象报餐记录
     * 
     * @param mealServiceObjects 服务对象报餐记录
     * @return 结果
     */
    @Override
    public int updateMealServiceObjects(MealServiceObjects mealServiceObjects)
    {
        mealServiceObjects.setUpdateTime(DateUtils.getNowDate());
        return mealServiceObjectsMapper.updateMealServiceObjects(mealServiceObjects);
    }

    /**
     * 批量删除服务对象报餐记录
     * 
     * @param ids 需要删除的服务对象报餐记录主键
     * @return 结果
     */
    @Override
    public int deleteMealServiceObjectsByIds(String ids)
    {
        return mealServiceObjectsMapper.deleteMealServiceObjectsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除服务对象报餐记录信息
     * 
     * @param id 服务对象报餐记录主键
     * @return 结果
     */
    @Override
    public int deleteMealServiceObjectsById(Integer id)
    {
        return mealServiceObjectsMapper.deleteMealServiceObjectsById(id);
    }
}
